﻿using B.S.Traceability.Domain;
using B.S.Traceability.Error;
using B.S.Traceability.Read.API.Application.Commends.IntegrateImg;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Traceability.Read.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class IntegrateImgController : ControllerBase
    {
        private readonly IMediator mediator;

        public IntegrateImgController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 获取图片信息
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<APIResult<List<IntegrateImgs>>> GetIntegrateImg([FromQuery]GetIntegrateImgCommends request, CancellationToken cancellationToken)
        {
            return await mediator.Send(request, cancellationToken);
        }

        /// <summary>
        /// 获取企业图片信息
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<APIResult<List<IntegrateImgs>>> GetCompanysImg([FromQuery]GetCompanysImgCommends request, CancellationToken cancellationToken)
        {
            return await mediator.Send(request, cancellationToken);
        }

        /// <summary>
        /// 获取动检图片信息
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<APIResult<List<IntegrateImgs>>> GetDynamicImg([FromQuery]GetDynamicImgCommends request, CancellationToken cancellationToken)
        {
            return await mediator.Send(request, cancellationToken);

        }

        /// <summary>
        /// 获取资质图片
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<APIResult<List<IntegrateImgs>>> GetQualificationsImg([FromQuery]GetQualificationsImgCommends request, CancellationToken cancellationToken)
        {
            return await mediator.Send(request, cancellationToken);
        }


        /// <summary>
        /// 获取 屠宰企业图片信息
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<APIResult<List<IntegrateImgs>>> GetSlaughterFirmsImg([FromQuery]GetSlaughterFirmsImgCommends request, CancellationToken cancellationToken)
        {
            return await mediator.Send(request, cancellationToken);
        }


        /// <summary>
        /// 获取 食品安全图片信息
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<APIResult<List<IntegrateImgs>>> GetProcessFirmsImg([FromQuery]GetProcessFirmsImgCommends request, CancellationToken cancellationToken)
        {
            return await mediator.Send(request, cancellationToken);
        }
    }
}
